package com.gwtplatform.samples.tab.client.info;

import com.google.inject.Inject;

import com.guit.client.GuitPresenter;
import com.guit.client.binder.GuitBinder;
import com.guit.client.place.Place;
import com.guit.client.place.PlaceName;
import com.gwtplatform.samples.tab.client.info.HomeInfoPresenter.HomeInfoBinder;
import com.gwtplatform.samples.tab.client.main.MainPresenter;
import com.gwtplatform.samples.tab.client.main.MainPresenter.Home;

@PlaceName("info")
public class HomeInfoPresenter extends GuitPresenter<HomeInfoBinder> implements Place<Void> {

    public static interface HomeInfoBinder extends GuitBinder<HomeInfoPresenter> {
    }

    private final MainPresenter mainPresenter;
    
    @Inject
    public HomeInfoPresenter(MainPresenter mainPresenter) {
        this.mainPresenter = mainPresenter;
    }

    @Override
    public void go(Void data) {
        mainPresenter.setHome(Home.INFO, getView());
    }
}
